#define _CRT_SECURE_NO_WARNINGS   1

#include<iostream>
#include<vector>
#include<string>
using namespace std;

class Solution
{
public:
	vector<string> getSolution(int n)
	{
		vector<string> ans;
		solution(n, "left", "right", "mid", ans);
		return ans;
	}
	void solution(int n, string start, string end,
		string pass, vector<string>& ans)
	{
		if (n == 0) 
			return;
		solution(n - 1, start, pass, end, ans);
		string path = "move from " + start + " to " + end;
		ans.push_back(path);
		solution(n - 1, pass, end, start, ans);
	}
};

int main()
{
	int n;
	cin >> n;
	Solution sol;
	vector<string>path1=sol.getSolution(n);
	for (auto e : path1)
	{
		cout << e << endl;
	}
}